#include<bits/stdc++.h>
using namespace std;
int a[100007],tot=1,n;
bool used[100007];
int BS(int x){
    int l=0,r=n,ans=-1;
    while(l<=r){
        int mid=l+r>>1;
        if(a[mid]<=x)l=mid+1;
        else r=mid-1,ans=mid;
    }
    if(ans==-1)return -1;
    for(int i=ans;i<=n;i++){
        if(!used[i])return i;
    }
    return -1;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        //cin>>a[i];
        //cout<<a[i]<<' '<<i<<' ';
    }
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        int m=BS(a[tot]);
        if(m!=-1){
            tot++;
            used[m]=true;
        }
    }
    cout<<n-tot+1;
    return 0;
}
